<html>
<body>

<script type="text/javascript">

var path="/base/menu/ajax/index.html";
var hash = "page/dashboard";
//var hash = "page/dashboard?bac=1&bcd=2";


document.write("path0:"+path +"<br>");

// 得到 path 中的 index 字符串 
var path_page_name= path.substring(path.lastIndexOf("/")+1,path.lastIndexOf("."));
//得到 hash 中的 dashboard 字符串
var hash_page_name="",hash_para_name="",final_path="";
if(hash.indexOf("?") > 0)
{
	hash_page_name=hash.substring(hash.lastIndexOf("/")+1,hash.lastIndexOf("?"));
    hash_para_name ="?"+hash.replace(/.*\?/, '');
	
}else{
	
	hash_page_name=hash.replace(/^page\//, '');
}

path = path.replace(path_page_name,hash_page_name); // 替换跳转页面名称
path2 = path+hash_para_name; // 添加参数
document.write("path:"+path +"<br>");

document.write("hash_para_name:"+hash_para_name +"<br>");

document.write("path2:"+path2 +"<br>");

</script>

</body>
</html>